import { useContext } from "react";
import { ThemeContext } from "./index";
import type { ITheme } from "./index";

export function ChildComponent2() {
  const { themeColor }: ITheme = useContext(ThemeContext);
  const style = {
    color: themeColor,
  };

  return (
    <div>
      <h2>ChildComponent2</h2>
      <p style={style}>子组件2：主题颜色：{themeColor}</p>
    </div>
  );
}
